package com.wondertek.service.dto.sys.res;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;

/**
 * @author xqs
 */
@Data
public class SysDepartUserRes {

    public SysDepartUserRes() {}

    public SysDepartUserRes(String id, String departName, String parentId) {
        this.id = id;
        this.departName = departName;
        this.parentId = parentId;
    }

    @Schema(name = "id",description = "id")
    private String id;

    @Schema(name = "departName",description = "部门名称")
    private String departName;

    @Schema(name = "parentId",description = "父级ID")
    private String parentId;

    @Schema(name = "children",description = "子部门")
    private List<SysDepartUserRes> children = new ArrayList<>();

    @Schema(name = "users",description = "部门用户")
    private List<User> users = new ArrayList<>();

    @Data
    public static class User{

        public User() {}
        public User(String userId, String username, String nickname, List<String> departIds, boolean isLeader) {
            this.userId = userId;
            this.username = username;
            this.nickname = nickname;
            this.departIds = departIds;
            this.isLeader = isLeader;
        }

        private String userId;
        @Schema(name = "username",description = "用户名")
        private String username;
        @Schema(name = "nickname",description = "昵称")
        private String nickname;
        @Schema(name = "departId",description = "组织Id")
        private List<String> departIds;
        @Schema(name = "isLeader",description = "是不是负责人")
        private boolean isLeader;
    }
}
